<script type="text/javascript">

var clickCount = 0;

function replaceImg(guid, base64) {
    var imageControl = document.getElementById(guid);

    if (imageControl) {
        imageControl.src = 'data:image/gif;base64,' + base64;
    }

    //alert(imageControl);
}

function replaceDivContent(id, newContent) {
    var localDiv = document.getElementById(id);

    if (localDiv) {
        localDiv.innerHTML = newContent;
    }
}

function replaceLoading(newContent) {
    replaceDivContent('CraftingDiv', newContent);
}

function itemClick(itemDataValue) {
    var longUrl = window.location.href;
    var split = longUrl.split("#");
    var url = split[0];
    clickCount++;

    // Update the location of the window
    window.location.href = url + '#' + itemDataValue + '&c=' + clickCount;
}

//function itemTapped(uri, param) {
//    alert(ui);
//}

function linkTapped(filename, param) {
    alert(filename);
}

</script>